{"ast":null,"code":"var __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport * as React from 'react';\nimport { useNotification as useRcNotification } from 'rc-notification';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider';\nimport { getPlacementStyle, getMotion } from './util';\nimport warning from '../_util/warning';\nimport useStyle from './style';\nimport { getCloseIcon, PureContent } from './PurePanel';\nconst DEFAULT_OFFSET = 24;\nconst DEFAULT_DURATION = 4.5;\nconst Holder = /*#__PURE__*/React.forwardRef((props, ref) => {\n  const {\n    top,\n    bottom,\n    prefixCls: staticPrefixCls,\n    getContainer: staticGetContainer,\n    maxCount,\n    rtl,\n    onAllRemoved\n  } = props;\n  const {\n    getPrefixCls,\n    getPopupContainer\n  } = React.useContext(ConfigContext);\n  const prefixCls = staticPrefixCls || getPrefixCls('notification');\n  // =============================== Style ===============================\n  const getStyle = placement => getPlacementStyle(placement, top !== null && top !== void 0 ? top : DEFAULT_OFFSET, bottom !== null && bottom !== void 0 ? bottom : DEFAULT_OFFSET);\n  // Style\n  const [, hashId] = useStyle(prefixCls);\n  const getClassName = () => classNames(hashId, {\n    [`${prefixCls}-rtl`]: rtl\n  });\n  // ============================== Motion ===============================\n  const getNotificationMotion = () => getMotion(prefixCls);\n  // ============================== Origin ===============================\n  const [api, holder] = useRcNotification({\n    prefixCls,\n    style: getStyle,\n    className: getClassName,\n    motion: getNotificationMotion,\n    closable: true,\n    closeIcon: getCloseIcon(prefixCls),\n    duration: DEFAULT_DURATION,\n    getContainer: () => (staticGetContainer === null || staticGetContainer === void 0 ? void 0 : staticGetContainer()) || (getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer()) || document.body,\n    maxCount,\n    onAllRemoved\n  });\n  // ================================ Ref ================================\n  React.useImperativeHandle(ref, () => Object.assign(Object.assign({}, api), {\n    prefixCls,\n    hashId\n  }));\n  return holder;\n});\n// ==============================================================================\n// ==                                   Hook                                   ==\n// ==============================================================================\nexport function useInternalNotification(notificationConfig) {\n  const holderRef = React.useRef(null);\n  // ================================ API ================================\n  const wrapAPI = React.useMemo(() => {\n    // Wrap with notification content\n    // >>> Open\n    const open = config => {\n      if (!holderRef.current) {\n        process.env.NODE_ENV !== \"production\" ? warning(false, 'Notification', 'You are calling notice in render which will break in React 18 concurrent mode. Please trigger in effect instead.') : void 0;\n        return;\n      }\n      const {\n        open: originOpen,\n        prefixCls,\n        hashId\n      } = holderRef.current;\n      const noticePrefixCls = `${prefixCls}-notice`;\n      const {\n          message,\n          description,\n          icon,\n          type,\n          placement = 'topRight',\n          btn,\n          className\n        } = config,\n        restConfig = __rest(config, [\"message\", \"description\", \"icon\", \"type\", \"placement\", \"btn\", \"className\"]);\n      return originOpen(Object.assign(Object.assign({}, restConfig), {\n        content: /*#__PURE__*/React.createElement(PureContent, {\n          prefixCls: noticePrefixCls,\n          icon: icon,\n          type: type,\n          message: message,\n          description: description,\n          btn: btn\n        }),\n        placement,\n        className: classNames(type && `${noticePrefixCls}-${type}`, hashId, className)\n      }));\n    };\n    // >>> destroy\n    const destroy = key => {\n      var _a, _b;\n      if (key !== undefined) {\n        (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.close(key);\n      } else {\n        (_b = holderRef.current) === null || _b === void 0 ? void 0 : _b.destroy();\n      }\n    };\n    const clone = {\n      open,\n      destroy\n    };\n    const keys = ['success', 'info', 'warning', 'error'];\n    keys.forEach(type => {\n      clone[type] = config => open(Object.assign(Object.assign({}, config), {\n        type\n      }));\n    });\n    return clone;\n  }, []);\n  // ============================== Return ===============================\n  return [wrapAPI, /*#__PURE__*/React.createElement(Holder, Object.assign({\n    key: \"notification-holder\"\n  }, notificationConfig, {\n    ref: holderRef\n  }))];\n}\nexport default function useNotification(notificationConfig) {\n  return useInternalNotification(notificationConfig);\n}","map":{"version":3,"names":["__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","useNotification","useRcNotification","classNames","ConfigContext","getPlacementStyle","getMotion","warning","useStyle","getCloseIcon","PureContent","DEFAULT_OFFSET","DEFAULT_DURATION","Holder","forwardRef","props","ref","top","bottom","prefixCls","staticPrefixCls","getContainer","staticGetContainer","maxCount","rtl","onAllRemoved","getPrefixCls","getPopupContainer","useContext","getStyle","placement","hashId","getClassName","getNotificationMotion","api","holder","style","className","motion","closable","closeIcon","duration","document","body","useImperativeHandle","assign","useInternalNotification","notificationConfig","holderRef","useRef","wrapAPI","useMemo","open","config","current","process","env","NODE_ENV","originOpen","noticePrefixCls","message","description","icon","type","btn","restConfig","content","createElement","destroy","key","_a","_b","undefined","close","clone","keys","forEach"],"sources":["/data/messenger.client/node_modules/antd/es/notification/useNotification.js"],"sourcesContent":["var __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport * as React from 'react';\nimport { useNotification as useRcNotification } from 'rc-notification';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider';\nimport { getPlacementStyle, getMotion } from './util';\nimport warning from '../_util/warning';\nimport useStyle from './style';\nimport { getCloseIcon, PureContent } from './PurePanel';\nconst DEFAULT_OFFSET = 24;\nconst DEFAULT_DURATION = 4.5;\nconst Holder = /*#__PURE__*/React.forwardRef((props, ref) => {\n  const {\n    top,\n    bottom,\n    prefixCls: staticPrefixCls,\n    getContainer: staticGetContainer,\n    maxCount,\n    rtl,\n    onAllRemoved\n  } = props;\n  const {\n    getPrefixCls,\n    getPopupContainer\n  } = React.useContext(ConfigContext);\n  const prefixCls = staticPrefixCls || getPrefixCls('notification');\n  // =============================== Style ===============================\n  const getStyle = placement => getPlacementStyle(placement, top !== null && top !== void 0 ? top : DEFAULT_OFFSET, bottom !== null && bottom !== void 0 ? bottom : DEFAULT_OFFSET);\n  // Style\n  const [, hashId] = useStyle(prefixCls);\n  const getClassName = () => classNames(hashId, {\n    [`${prefixCls}-rtl`]: rtl\n  });\n  // ============================== Motion ===============================\n  const getNotificationMotion = () => getMotion(prefixCls);\n  // ============================== Origin ===============================\n  const [api, holder] = useRcNotification({\n    prefixCls,\n    style: getStyle,\n    className: getClassName,\n    motion: getNotificationMotion,\n    closable: true,\n    closeIcon: getCloseIcon(prefixCls),\n    duration: DEFAULT_DURATION,\n    getContainer: () => (staticGetContainer === null || staticGetContainer === void 0 ? void 0 : staticGetContainer()) || (getPopupContainer === null || getPopupContainer === void 0 ? void 0 : getPopupContainer()) || document.body,\n    maxCount,\n    onAllRemoved\n  });\n  // ================================ Ref ================================\n  React.useImperativeHandle(ref, () => Object.assign(Object.assign({}, api), {\n    prefixCls,\n    hashId\n  }));\n  return holder;\n});\n// ==============================================================================\n// ==                                   Hook                                   ==\n// ==============================================================================\nexport function useInternalNotification(notificationConfig) {\n  const holderRef = React.useRef(null);\n  // ================================ API ================================\n  const wrapAPI = React.useMemo(() => {\n    // Wrap with notification content\n    // >>> Open\n    const open = config => {\n      if (!holderRef.current) {\n        process.env.NODE_ENV !== \"production\" ? warning(false, 'Notification', 'You are calling notice in render which will break in React 18 concurrent mode. Please trigger in effect instead.') : void 0;\n        return;\n      }\n      const {\n        open: originOpen,\n        prefixCls,\n        hashId\n      } = holderRef.current;\n      const noticePrefixCls = `${prefixCls}-notice`;\n      const {\n          message,\n          description,\n          icon,\n          type,\n          placement = 'topRight',\n          btn,\n          className\n        } = config,\n        restConfig = __rest(config, [\"message\", \"description\", \"icon\", \"type\", \"placement\", \"btn\", \"className\"]);\n      return originOpen(Object.assign(Object.assign({}, restConfig), {\n        content: /*#__PURE__*/React.createElement(PureContent, {\n          prefixCls: noticePrefixCls,\n          icon: icon,\n          type: type,\n          message: message,\n          description: description,\n          btn: btn\n        }),\n        placement,\n        className: classNames(type && `${noticePrefixCls}-${type}`, hashId, className)\n      }));\n    };\n    // >>> destroy\n    const destroy = key => {\n      var _a, _b;\n      if (key !== undefined) {\n        (_a = holderRef.current) === null || _a === void 0 ? void 0 : _a.close(key);\n      } else {\n        (_b = holderRef.current) === null || _b === void 0 ? void 0 : _b.destroy();\n      }\n    };\n    const clone = {\n      open,\n      destroy\n    };\n    const keys = ['success', 'info', 'warning', 'error'];\n    keys.forEach(type => {\n      clone[type] = config => open(Object.assign(Object.assign({}, config), {\n        type\n      }));\n    });\n    return clone;\n  }, []);\n  // ============================== Return ===============================\n  return [wrapAPI, /*#__PURE__*/React.createElement(Holder, Object.assign({\n    key: \"notification-holder\"\n  }, notificationConfig, {\n    ref: holderRef\n  }))];\n}\nexport default function useNotification(notificationConfig) {\n  return useInternalNotification(notificationConfig);\n}"],"mappings":"AAAA,IAAIA,MAAM,GAAG,IAAI,IAAI,IAAI,CAACA,MAAM,IAAI,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,CAAC,GAAG,CAAC,CAAC;EACV,KAAK,IAAIC,CAAC,IAAIH,CAAC,EAAE,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAEG,CAAC,CAAC,IAAIF,CAAC,CAACO,OAAO,CAACL,CAAC,CAAC,GAAG,CAAC,EAAED,CAAC,CAACC,CAAC,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC;EAChG,IAAIH,CAAC,IAAI,IAAI,IAAI,OAAOI,MAAM,CAACK,qBAAqB,KAAK,UAAU,EAAE,KAAK,IAA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